<?php


function lib_topnavclass(&$ctag,&$refObj){
	 global $dsql;
	 //属性处理
	$attlist="row|100,typeid|0";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    
    $innertext = $ctag->GetInnerText();
    $where = " reid=".$typeid;
   
    
    $query = "SELECT id,typename FROM `#@__arctype` WHERE ".$where." ORDER BY sortrank ASC LIMIT ".$row;
    $dsql->Execute('fs', $query);
    $html = '<div style="display:none;" id="topnavproductdiv">';
    while ($row = $dsql->GetArray('fs')){
    	$html .= '<li><a href="/'.(($type=='brand') ? 'brand-' : 'list-').$row['id'].'.html" title="'.$row['typename'].'">'.$row['typename'].'</a></li>';
    }
   $html .= '</div>';
   $html .= '<script>$("#topnavproductdiv li:last a").css({"background":"none"});$(".subnav_27").html($("#topnavproductdiv").html());</script>';
   return $html;
}
?>